<!-- application/views/scripts/level/add-level.phtml -->

<div id="section-content">
<h2>Admin > Edit questionnaire</h2>
Please, complete the form below.

<?php
$this->form->setAction($this->url()."?questionnaire_id=".$this->questionnaire_id);
echo $this->form;

?>


<h3>Questions</h3>

<table class="general-table ui-widget ui-widget-content table" cellspacing="0" id="questions-table">
<thead>
    <tr class="ui-widget-header">
        <th>Question</th>
        <th><a href="<? echo $this->baseUrl() ?>/question/add-question/?questionnaire_id=<? echo $this->questionnaire_id ?>"><div class="ui-state-default ui-corner-all" title="New question" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-plus"></span></div></a></th>
    </tr>
</thead>
<tbody>
    
    
    <?php 
    
    $class = "odd";
    foreach ($this->questions as $entry): 
        $class = ($class=='even') ? 'odd' : 'even';
    ?>
        <tr class="<?php echo $class ?>">
            <td><?php echo $this->escape($entry->question) ?></td>
            <td class="actions">
                <a href="#" onclick="javascript:actionConfirm('<? echo $this->baseUrl() ?>/question/delete/?question_id=<?php echo $this->escape($entry->id) ?>');"><div class="ui-state-default ui-corner-all" title="Delete" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-trash"></span></div></a>
                <a href="<? echo $this->baseUrl() ?>/question/edit-question/?question_id=<?php echo $this->escape($entry->id) ?>"><div class="ui-state-default ui-corner-all" title="Edit" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-pencil"></span></div></a>
            </td>
        </tr>
    <?php  endforeach ?>    
    
</tbody>
</table>

</div>